﻿#pragma once

#include <memory>
#include "SourceCode/Renderer/Buffer.h"

namespace Hazal
{
	/// <summary>
	/// VAO对象接口
	/// </summary>
	class CVertexArray
	{
	public:
		virtual ~CVertexArray() {}

	public:
		/// <summary>
		/// 绑定当前VAO
		/// </summary>
		virtual void Bind() const = 0;

		/// <summary>
		/// 解绑当前VAO
		/// </summary>
		virtual void Unbind() const = 0;

		/// <summary>
		/// 添加VBO
		/// </summary>
		virtual void AddVertexBuffer(const Ref<CVertexBuffer>& rVertexBuffer) = 0;

		/// <summary>
		/// 添加IBO
		/// </summary>
		virtual void SetIndexBuffer(const Ref<CIndexBuffer>& rIndexBuffer) = 0;

		/// <summary>
		/// 获取当前对象拥有的VBOs
		/// </summary>
		virtual const std::vector<Ref<CVertexBuffer>>& GetVertexBuffers() const = 0;

		/// <summary>
		/// 获取当前对象拥有的IBO
		/// </summary>
		virtual const Ref<CIndexBuffer>& GetIndexBuffer() const = 0;

	public:
		static Ref<CVertexArray> Create();

	};
}
